<!--重新处理-->
<template>
    <div class="rehandle">
        <nav-com :navText="navText" :navTextDes="navTextDes"></nav-com>

        <div class="search-con">
            <Input v-model="numValue" placeholder="搜索取号码" style="width: 240px" />
            <Button @click="search"><img src="../../../static/images/search.png" class="search">查询</Button>
        </div>

        <div class="table-con" >
            <div :style="{ minHeight: height-170+'px'}">
                <table v-if="list.length>0">
                    <thead>
                        <tr>
                            <th>取号号码</th>
                            <th>类型</th>
                            <th>处理人</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(item,index) in list" :key="index">
                        <td>{{item.num}}</td>
                        <td>
                            <span v-if="item.type==0">现场取号</span>
                            <span v-else>微信取号</span>
                        </td>
                        <td>{{item.nickname}}</td>
                        <td><a class="rehandle-btn" @click="rehandleBtn(item)">重新处理</a></td>
                    </tr>
                    </tbody>
                </table>
                <div >
                    <table>
                        <thead>
                        <tr>
                            <th>取号号码</th>
                            <th>类型</th>
                            <th>处理人</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                    </table>
                    <div class="list-nodata">
                        暂无数据
                    </div>
                </div>
            </div>
        </div>

    </div>
</template>

<script>
    import navCom from '@/components/nav-com.vue';
    import {getoverturnlist,guahaoagain} from '@/api/inoculate/inoculate';

    export default {
        data () {
            return {
                navText: '挂号接种',
                navTextDes: '挂号',
                height: document.documentElement.clientHeight,
                list: [],

                numValue: '',

            }
        },
        mounted(){
            this.getData();
        },
        methods:{
            getData(){
                getoverturnlist({
                    num: this.numValue
                }).then((res) => {
                    if (res.data.error == 0) {
                       this.list=res.data.list;
                    } else {
                        this.$Message.error(res.data.message);
                    }
                })
            },
            rehandleBtn(val){
                let that=this;
                guahaoagain({
                    id: val.id
                }).then((res) => {
                    if (res.data.error == 0) {
                        that.$router.back(-1);
                    } else {
                        this.$Message.error(res.data.message);
                    }
                })
            },
            search(){
                this.getData();
            },
        },
        components: {
            navCom
        },
    }
</script>

<style lang="less">
    .rehandle{
        .search-con{
            height: 40px;
            border-radius: 0;
            margin-top:8px;
            .ivu-btn{
                background:rgba(93,140,254,1);
                border-radius:0;
                padding: 4px 15px;
                .search{
                    width:17px;
                    height: 18px;
                    vertical-align: middle;
                    margin-right: 5px;
                }
                span{
                    font-size:12px;
                    font-family:PingFang-SC-Bold;
                    color:rgba(255,255,255,1);
                    vertical-align: middle;
                }
            }
            .ivu-input{
                border-radius: 0;
            }
        }
        .table-con{
            background: #fff;
            table{
                width:100%;
                border-collapse:collapse;
                text-align: center;
                thead{
                    height:38px;
                    line-height: 38px;
                    background:rgba(93,140,254,1);
                    font-size:14px;
                    color:rgba(255,255,255,1);
                    th{
                        font-weight: normal;
                    }
                }
                tbody{
                    background:rgba(245,250,255,1);
                    height:48px;
                    line-height: 48px;
                    font-size:14px;
                    color:rgba(53,76,107,1);
                }
            }
            .rehandle-btn{
                font-size:14px;
                font-family:PingFang-SC-Bold;
                color:#26D8C0;
            }
        }
    }
</style>
